﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="OpenManageRoleProgramMapping.ascx.cs"
    Inherits="WebForm_ManageRole_OpenManageRoleProgramMapping" %>
<asp:Panel ID="panel1" runat="server" BackColor="white" BorderWidth="1" Style="cursor: move;
    display: none" Width="600" Height="500">
    <br />
    <div align="center">
        <asp:Label ID="lblTitle" runat="server" Text="<%$ Resources:Title %>" SkinID="title"></asp:Label>
    </div>
    <table width="100%">
        <tr>
            <td>
                <asp:Label ID="lblProgramGroup" runat="server" Text="<%$ Resources:ProgramGroup%>"></asp:Label>
                <TServerControl:TDropDownList ID="ddlProgramGroup" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource_ProgramGroup"
                    DataTextField="ProgramName" DataValueField="ProgramID" OnSelectedIndexChanged="ddlProgramGroup_SelectedIndexChanged">
                </TServerControl:TDropDownList>
                <asp:SqlDataSource ID="SqlDataSource_ProgramGroup" runat="server" ConnectionString="<%$ ConnectionStrings:connStr %>"
                    SelectCommand="SELECT 0 as ProgramID,'全部' as ProgramName,0 as Sequence
UNION
SELECT ProgramID,ProgramName,Sequence
FROM FD_Program
WHERE PArent=0 AND Active='Y' AND Editable='Y'
ORDER BY ProgramID"></asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td>
                <TServerControl:TGridView ID="TGridView1" runat="server" AllowHoverEffect="True"
                    AllowHoverSelect="True" ShowFooterWhenEmpty="False"
                    ShowHeaderWhenEmpty="False" TotalRowCount="0" AutoGenerateColumns="False" DataKeyNames="ProgramID"
                    SkinID="pager" OnPageIndexChanged="TGridView1_PageIndexChanged" 
                    onrowdatabound="TGridView1_RowDataBound">
                    <Columns>
                        <asp:BoundField DataField="ProgramName" HeaderText="<%$ Resources:ProgramName %>"
                            SortExpression="ProgramName" />
                        <asp:TemplateField HeaderText="<%$ Resources:CanAccess %>">
                            <ItemTemplate>
                                <asp:CheckBox ID="CheckBox1" runat="server" Enabled='<%# BooleanConverter(Eval("IsInherits")) %>'  Checked='<%# BooleanConverter(Eval("CanAccess")) %>'
                                    OnCheckedChanged="CheckBox1_CheckedChanged" AutoPostBack="True" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                </TServerControl:TGridView>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="BLL_Delete"
                    InsertMethod="BLL_Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="BLL_Select"
                    TypeName="BLL_ManageRoleProgramMapping">
                    <DeleteParameters>
                        <asp:Parameter Name="original_RoleID" Type="Int32" />
                        <asp:Parameter Name="original_ProgramID" Type="Int32" />
                    </DeleteParameters>
                    <SelectParameters>
                        <asp:Parameter Name="RoleID" Type="Int32" />
                        <asp:Parameter Name="Parent" Type="Int32" />
                    </SelectParameters>
                    <InsertParameters>
                        <asp:Parameter Name="RoleID" Type="Int32" />
                        <asp:Parameter Name="ProgramID" Type="Int32" />
                    </InsertParameters>
                </asp:ObjectDataSource>
            </td>
        </tr>
    </table>
    <div align="center">
        <asp:ImageButton ID="btnOK" ImageUrl="~/images/image/but_06.jpg" runat="server" />
        <asp:ImageButton ID="btnCancel" ImageUrl="~/images/image/but_20.jpg" runat="server" />
    </div>
</asp:Panel>
<asp:Button ID="btnDummy" runat="server" SkinID="null" Style="display: none" />
<ajaxToolkit:ModalPopupExtender ID="mpSearch" runat="server" CancelControlID="btnCancel"
    PopupControlID="panel1" PopupDragHandleControlID="panel1" TargetControlID="btnDummy" />
